<template>
  <div id="app">
    <div v-if="isShowChildPage">
      <keep-alive
      exclude="houserentout,register,updatahouseinfo,allcollect,businesshousecollect,onlywc,plainhousecollect,commenthouses,login,toappointmenthouse,updatapassword,logout,serchhouse,housedetail,areasearch,comment,dianzan,pending,myappointment,housecomment,detailswiper,hotserch,serchhouseaaa,synthesize,houseappointment,"
    >
      <router-view />
    </keep-alive>
    </div>
  </div>
</template>

<script>
import { requsetImgPath } from "network/uploadImg";
import { getLocation } from "common/utils";
import { mapMutations } from "vuex";

export default {
  data() {
    return {
      city: " ",
      isShowChildPage:false
    };
  },
  methods: {
    ...mapMutations({
      getCity: "moduleHotCity/getCity",
      getCurrentCity: "moduleHotCity/getCurrentCity",
      getCurrentRentPath: "moduleUser/getCurrentRentPath",
      getStaticpath:"moduleUser/getStaticpath"
    }),
    onClickLeft() {
      console.log(111);
    },
    onClickRight() {
      console.log(456);
    },
  },
  created() {
    this.getCity(this.city);
    localStorage.setItem("currentCity", this.city);
    this.getCurrentRentPath("/rentstate/allstate");
    localStorage.setItem("currentRentPath", "/rentstate/allstate");

    requsetImgPath().then((res) => {
      this.getStaticpath(res.data)
      localStorage.setItem("staticpath", res.data);
    });

    getLocation((data) => {
      this.isShowChildPage = true
      this.city = data.replace("市", "");
      localStorage.setItem("currentCity", this.city);
      this.getCurrentCity(this.city);
      localStorage.setItem("city",this.city);
      this.getCity(this.city);
      console.log(this.city);
    });
  },
};
</script>

<style>
@import "assets/css/base.css";
.box {
  background-color: #ff5654;
}
</style>
